# dir declaration
LIB_SECURESHIELD_EXPORT_DIR = $(LIB_SECURESHIELD_DIR)/export

LIB_SECURESHIELD_EXPORT_ASMSRCDIR	= $(LIB_SECURESHIELD_EXPORT_DIR)/src

LIB_SECURESHIELD_EXPORT_CSRCDIR		= $(LIB_SECURESHIELD_EXPORT_DIR)/src

LIB_SECURESHIELD_EXPORT_INCDIR		= $(LIB_SECURESHIELD_EXPORT_DIR)/inc

# find all the source files in the target directories
LIB_SECURESHIELD_EXPORT_CSRCS = $(call get_csrcs, $(LIB_SECURESHIELD_EXPORT_CSRCDIR))
LIB_SECURESHIELD_EXPORT_ASMSRCS = $(call get_asmsrcs, $(LIB_SECURESHIELD_EXPORT_ASMSRCDIR))

# get object files
LIB_SECURESHIELD_EXPORT_COBJS = $(call get_relobjs, $(LIB_SECURESHIELD_EXPORT_CSRCS))
LIB_SECURESHIELD_EXPORT_ASMOBJS = $(call get_relobjs, $(LIB_SECURESHIELD_EXPORT_ASMSRCS))
LIB_SECURESHIELD_EXPORT_OBJS = $(LIB_SECURESHIELD_EXPORT_COBJS) $(LIB_SECURESHIELD_EXPORT_ASMOBJS)

# get dependency files
LIB_SECURESHIELD_EXPORT_DEPS = $(call get_deps, $(LIB_SECURESHIELD_EXPORT_OBJS))

# extra macros to be defined
LIB_SECURESHIELD_EXPORT_DEFINES = -DLIB_SECURESHIELD_EXPORT

# compile options only valid in this library
LIB_SECURESHIELD_EXPORT_COMPILE_OPT =


# generate library
LIB_LIB_SECURESHIELD_EXPORT = $(OUT_DIR)/libsecureshield_export.a

# library generation rule
$(LIB_LIB_SECURESHIELD_EXPORT): $(LIB_SECURESHIELD_EXPORT_OBJS)
	$(TRACE_ARCHIVE)
	$(Q)$(AR) $(AR_OPT) $@ $(LIB_SECURESHIELD_EXPORT_OBJS)

# specific compile rules
# user can add rules to compile this middleware
# if not rules specified to this middleware, it will use default compiling rules

# .SECONDEXPANSION:
# $(LIB_SECURESHIELD_EXPORT_COBJS): $(OUT_DIR)/%.o :$(EMBARC_ROOT)/%.c $$(COMMON_COMPILE_PREREQUISITES)
# 	$(TRACE_COMPILE)
# 	$(TRY_MK_OBJDIR)
# 	$(Q)$(CC) -c $(COMPILE_OPT) $(LIB_SECURESHIELD_EXPORT_COMPILE_OPT) $< -o $@

.SECONDEXPANSION:
$(LIB_SECURESHIELD_EXPORT_ASMOBJS): $(OUT_DIR)/%.o :$(EMBARC_ROOT)/%.s $$(COMMON_COMPILE_PREREQUISITES) $(SECURESHIELD_SECURE).bin
	$(TRACE_ASSEMBLE)
	$(TRY_MK_OBJDIR)
	$(Q)$(CC) -c $(ASM_OPT) -DSECURESHIELD_SECURE_BIN=\"$(SECURESHIELD_SECURE).bin\" $(LIB_SECURESHIELD_EXPORT_ASM_COPT) $< -o $@

# Middleware Definitions
LIB_INCDIR += $(LIB_SECURESHIELD_EXPORT_INCDIR)
LIB_CSRCDIR += $(LIB_SECURESHIELD_EXPORT_CSRCDIR)
LIB_ASMSRCDIR += $(LIB_SECURESHIELD_EXPORT_ASMSRCDIR)

LIB_CSRCS += $(LIB_SECURESHIELD_EXPORT_CSRCS)
LIB_CXXSRCS +=
LIB_ASMSRCS += $(LIB_SECURESHIELD_EXPORT_ASMSRCS)
LIB_ALLSRCS += $(LIB_SECURESHIELD_EXPORT_CSRCS) $(LIB_SECURESHIELD_EXPORT_ASMSRCS)

LIB_COBJS += $(LIB_SECURESHIELD_EXPORT_COBJS)
LIB_CXXOBJS +=
LIB_ASMOBJS += $(LIB_SECURESHIELD_EXPORT_ASMOBJS)
LIB_ALLOBJS += $(LIB_SECURESHIELD_EXPORT_OBJS)

LIB_DEFINES += $(LIB_SECURESHIELD_EXPORT_DEFINES)
LIB_DEPS += $(LIB_SECURESHIELD_EXPORT_DEPS)
LIB_LIBS += $(LIB_LIB_SECURESHIELD_EXPORT)
